package org.jarraiders.musiclibrary.client.event;

import org.jarraiders.musiclibrary.shared.domain.TrackDTO;

import com.google.gwt.event.shared.GwtEvent;

public class TrackUpdatedEvent extends GwtEvent<TrackUpdatedEventHandler>{
  public static Type<TrackUpdatedEventHandler> TYPE = new Type<TrackUpdatedEventHandler>();
  private final TrackDTO updatedTrack;
  
  public TrackUpdatedEvent(TrackDTO result) {
    this.updatedTrack = result;
  }
  
  public TrackDTO getUpdatedTrack() { return updatedTrack; }
  

  @Override
  public Type<TrackUpdatedEventHandler> getAssociatedType() {
    return TYPE;
  }

  @Override
  protected void dispatch(TrackUpdatedEventHandler handler) {
    handler.onTrackUpdated(this);
  }
}
